<?php
/* @var $this CategorieController */
/* @var $model Categories */

$this->breadcrumbs=array(
	'Categories'=>array('index'),
	'Manage',
);

$this->menu=array(
	array('label'=>'List Categories', 'url'=>array('index')),
	array('label'=>'Create Categories', 'url'=>array('create')),
);

?>

	

    <div class="content-box">
      <!-- Start Content Box -->
      <div class="content-box-header">
        <h3>管理分类</h3>
        <ul class="content-box-tabs">
          <li><a href="<?php echo $this->createUrl('/backend/categorie')?>" class="default-tab current">分类列表</a></li>
          <li><a href="<?php echo $this->createUrl('/backend/addcategorie')?>">增加分类</a></li>
        </ul>
        <div class="clear"></div>
      </div>
      <!-- End .content-box-header -->
      <div class="content-box-content">
        <div class="tab-content default-tab" id="tab1">          
          
        <?php
		$this->widget('zii.widgets.grid.CGridView', array(
			'id'=>'categories-grid',
			'dataProvider'=>$model->search(),
			'filter'=>$model,
			'columns'=>array(
				array(
					'name'=>'ordering',
					'htmlOptions'=>array(
								'style'=>'text-align:center;  vertical-align:middle; width:8%;',
					),
				),
				'name',
				array(
					'name'=>'parent',
					'value' => 'Categories::model()->findCategorietName($data->parent)',
				),
				//'category_image_url',
				//'description',
				//'param',
				//'ordering',
				//array('header'=>'父分类', 'value' => 'Categories::model()->findParentName($data->parent)'),
				//array('header'=>'发布状态','type' => 'raw' , 'name' => 'published'),
		
				array(
					'header'=>'操作',
					'class'=>'CButtonColumn',
					'template'=>'{update} {delete}',
					'htmlOptions'=>array(
							'style'=>'text-align:center;  vertical-align:middle',
					),
					'buttons' => array(
						'update'=>array(
								'label'=>'更新',
								'url'=>'array("/backend/updatecategorie/$data->id")',
						),
						'delete'=>array(				
								'label'=>'删除',				
								'url'=>'array("/backend/delcategorie/$data->id")',								
						),
					),	
				),
			),
		)); 
		
		//var_dump($model->search());
		
		?>
        </div>
        <!-- End #tab1 -->
        <div class="tab-content" id="tab2">         
            <fieldset>
		
            </fieldset>
            <div class="clear"></div>
            <!-- End .clear -->          
        </div>
        <!-- End #tab2 -->
      </div>
      <!-- End .content-box-content -->
    </div>
    <!-- End .content-box -->